<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 认识函数参数的默认值
        //调用函数的时候传参了，就用传递的参数如果没传参，就用默认值
        //函数传参的默认值
        const multiple = (x, y) => {
            if (typeof y === 'undefined') {
                y = 1;
            }
            return x * y;
        }
        console.log(multiple(2, 2)); //4
    </script>
</body>

</html>